#ifndef KCPPACKET_H
#define KCPPACKET_H
#include <stdint.h>
#include <netinet/in.h>
#include <vector>
#include <string>

using namespace std;
namespace KCPPacketCMD {
	enum KCPPacketCMD {
		CMD_PUSH,
		CMD_WAITACK,
		CMD_ACKED,
	};
}

class KCPPacket 
{
public:
	shared_ptr< std::vector<unsigned char> > data;
	KCPPacketCMD::KCPPacketCMD cmd;
	uint32_t sn;
	bool acked = false;
	bool isAck = false;
	int ackTimeout = 1;
	double sendTime = 1;
	string remoteEnd;

	void EncodeFull();
	void DecodeData(std::vector<unsigned char> &rcData);
	std::vector<unsigned char> *GetFullData(){
		return &fullData;
	}
private:
	std::vector<unsigned char> fullData;

};
#endif